package top.kaoshanji.p1ch09a;

/**
 * 代码清单-p1ch09a-82页a：女娲重造人类
 * @author kaoshanji
 * ^_^
 * create time 2025/3/21 18:21
 */
public class NvWa {

    public static void main(String[] args) {

        // 第一条生产线，男性生产线
        HumanFactory maleHumanFactory = new MaleFactory();

        // 第二条生产线，女性生产线
        HumanFactory femaleHumanFactory = new FemaleFactory();

        // 生产线建立完毕，开始生产人了：
        Human maleYellowHuman = maleHumanFactory.createYellowHuman(); // 黄人、男
        Human femaleYellowHuman = femaleHumanFactory.createYellowHuman(); // 黄人、女

        System.out.println("---生产一个黄人女性---");
        femaleYellowHuman.getColor();
        femaleYellowHuman.talk();
        femaleYellowHuman.getSex();

        System.out.println("---生产一个黄人男性---");
        maleYellowHuman.getColor();
        maleYellowHuman.talk();
        maleYellowHuman.getSex();

    }

}
